// 表格列
import tagRender from '@/components/aggridCellRenDerer/tagRender.vue'

let tableColumns: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '公司',
        field: 'companyName',
        width: 180,
    },
    {
        headerName: '部门',
        field: 'outDepartment',
        width: 180,
    },
    {
        headerName: '类型',
        field: 'type',
        width: 180,
    },
    {
        headerName: '供应商名称',
        field: 'supplierName',
        width: 180,
    },
    {
        headerName: '客户名称',
        field: 'customerName',
        width: 180,
    },
    {
        headerName: '固定资产编号',
        field: 'numberId',
        width: 180,
    },
    {
        headerName: '物料大类',
        field: 'majorCategory',
        width: 180,
    },
    {
        headerName: '物料中类',
        field: 'middleCategory',
        width: 150,
    },
    {
        headerName: '物料小类',
        field: 'subCategory',
        width: 180,
    },
    {
        headerName: '物料编号',
        field: 'materialCode',
        width: 180,
    },
    {
        headerName: '物料名称',
        field: 'materialName',
        width: 180,
    },
    {
        headerName: '规格',
        field: 'specification',
        width: 180,
    },
    {
        headerName: '总数',
        field: 'totalNum',
        width: 180,
    },
    {
        headerName: '单位',
        field: 'unit',
        width: 180,
    },
    {
        headerName: '购入金额',
        field: 'price',
        width: 180,
    },
    {
        headerName: '等级',
        field: 'grade',
        width: 180,
    },
    {
        headerName: '资产类型',
        field: 'propertyType',
        width: 180,
    },
    {
        headerName: '所属区域',
        field: 'district',
        width: 180,
    },
    {
        headerName: '位置号',
        field: 'floorDistrict',
        width: 180,
    },
    {
        headerName: '分摊年限',
        field: 'shareYears',
        width: 180,
    },
    {
        headerName: '分摊类型',
        field: 'shareType',
        width: 180,
    },
    {
        headerName: '入厂时间',
        field: 'joinFactoryTime',
        width: 180,
    },
    {
        headerName: '备注',
        field: 'remark',
        width: 180,
    },
    {
        headerName: '领料人工号',
        field: 'outNameCode',
        width: 180,
    },
    {
        headerName: '领料人',
        field: 'outName',
        width: 180,
    },
    {
        headerName: '领料日期',
        field: 'outTime',
        width: 180,
    },
    {
        headerName: '使用人',
        field: 'usePerson',
        width: 180,
    },
    {
        headerName: '机器产量',
        field: 'machineNum',
        width: 180,
    },
    {
        headerName: '极限产能',
        field: 'maxCapacity',
        width: 180,
    },
    {
        headerName: '产能单位',
        field: 'capacityUnit',
        width: 180,
    },
    {
        headerName: '是否出库',
        field: 'toolStockState',
        resizable: 'false',
        filter: 'false',
        sortable: 'false',
        width: 150,
        pinned: 'right',
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.toolStockState == 0
                    ? 'warning'
                    : params.rowsState == 1
                        ? 'success' : ''

            },
            text: (params: any) => {
                return params.toolStockState == 0
                    ? '未出库'
                    : params.toolStockState == 1
                        ? '已出库' : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == 0
                    ? '未出库'
                    : params.value == 1
                        ? '已出库' : ''
            },
        }
    },
    {
        headerName: '调拨状态',
        field: 'fixedShiftState',
        resizable: 'false',
        filter: 'false',
        sortable: 'false',
        width: 150,
        pinned: 'right',
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.fixedShiftState == 0
                    ? 'info'
                    : params.fixedShiftState == 1
                        ? 'warning' : params.fixedShiftState == 2 ? 'success' : ''

            },
            text: (params: any) => {
                return params.fixedShiftState == 0
                    ? '未调拨'
                    : params.fixedShiftState == 1
                        ? '调拨中' : params.fixedShiftState == 2 ? '调拨已接收' : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == 0
                    ? '未调拨'
                    : params.value == 1
                        ? '调拨中' : params.value == 2
                            ? '调拨已接收' : ''
            },
        }
    },
    {
        headerName: '借出状态',
        field: 'fixedAssetsBorrowState',
        resizable: 'false',
        filter: 'false',
        sortable: 'false',
        width: 150,
        // lockPosition: 'right',
        pinned: 'right',
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.fixedAssetsBorrowState == 0 ? 'info' : params.fixedAssetsBorrowState == 1 ? 'info' : params.fixedAssetsBorrowState == 2 ? 'success' : params.fixedAssetsBorrowState == 3 ? 'success' : ''

            },
            text: (params: any) => {
                return params.fixedAssetsBorrowState == 0
                    ? '未借出'
                    : params.fixedAssetsBorrowState == 1
                        ? '待借出' : params.fixedAssetsBorrowState == 2 ? '已借出' : params.fixedAssetsBorrowState == 3 ? '已归还' : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == 0
                    ? '未借出'
                    : params.value == 1
                        ? '待借出' : params.value == 2
                            ? '已借出' : params.value == 3
                                ? '已归还' : ''
            },
        }
    },
    {
        headerName: '报废状态',
        field: 'fixedScrapState',
        resizable: 'false',
        filter: 'false',
        sortable: 'false',
        width: 150,
        // lockPosition: 'right',
        pinned: 'right',
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.fixedScrapState == 0 ? 'success' : params.fixedScrapState == 1 ? 'warning' : ''
            },
            text: (params: any) => {
                return params.fixedScrapState == 0
                    ? '未报废'
                    : params.fixedScrapState == 1
                        ? '已报废' : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == 0
                    ? '已报废'
                    : params.value == 1
                        ? '未报废' : ''
            },
        }
    }
]

export { tableColumns }
